import { MessageOutlined, SettingOutlined } from "@ant-design/icons";
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { get, put } from "../utils/request";
import "./css/list.scss";
import { useUserData } from "../hooks/userInfo";

function list() {
  const navigate = useNavigate();
  const { users } = useUserData();
  console.log(users);

  // put("/members/update_info", {
  //   nickName: "肥猫哥怒冲",
  //   avatar:
  //     "https://img2.baidu.com/it/u=1793746633,1083714856&fm=253&fmt=auto&app=138&f=GIF?w=449&h=461",
  //   mobile: "192-168-1888",
  //   address: "河南省郑州市高新区",
  // }).then((res) => {
  //   console.log(res.data);
  // });
  return (
    <>
      <div className="container2">
        <p className="me">
          我的
          <span className="right">
            <SettingOutlined
              onClick={() => {
                navigate("/user/modify-user");
              }}
            />{" "}
            <MessageOutlined />
          </span>
        </p>
        <hr />
        <img
          src={users?.avatar}
          alt=""
          className="img"
          style={{ marginLeft: "15vw" }}
        />
        {users?.nickName}
        <p>地址：{users.address}</p>
        <p>电话：{users.mobile}</p>
        <p>我的艺名：{users.userName}</p>
        <p
          className="details"
          onClick={() => {
            navigate("/user/quiz");
          }}
        >
          <span className="fa spanMiddle fa-question-circle-o"></span> 我的问诊
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-shopping-cart"></span>购买的讲堂
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-cart-arrow-down"></span>购买的药品
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-key"></span>工具箱
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-diamond"></span>我的优惠
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-user"></span>家庭成员
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-user-circle-o"></span>关注的医生
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-star"></span>我的收藏
        </p>
        <p className="details">
          <span className="fa spanMiddle fa-comment"></span>用户反馈
        </p>
      </div>
    </>
  );
}

export default list;
